import {ObjectDto, ObjectDtoInterface, TableColumnType} from "../../services/sqliteDB/object.dto";
import {SyncStatus} from "../sync-status";

export class WorkOrderDto extends ObjectDto implements ObjectDtoInterface {

    public static tableName: "WorkOrders";

    public id: string = null; // 停/复电申请ID
    public applyId: string = null;
    public userId: string = null; //
    public chargeDetailId: string = null; // 催费记录ID
    public type: number = null; // 1 停电工单，2 复电工单
    public syncStatus: SyncStatus = SyncStatus.None;
    public workOrderStatus: number = null; // 停电状态,
    public createdTime: number = null; // 提交记录的时间
    public updatedTime: number = null;
    public createdBy: string = null; //
    public updatedBy: string = null;

    //
    // 停电执行信息
    //
    public isPerform: number = null; // 是否执行停/复电0 否，1 是
    public performerOne: string = null; //
    public performerOneMobile: string = null; //
    public performerOneAccount: string = null; //
    public performerTwo: string = null; //
    public performerTwoAccount: string = null; //
    public performerTwoMobile: string = null; //
    public sealType: number = null; // 封印类型，1 封条 2 封印
    public sealNO: number = null; // 封条封印编号
    public sealDeviceId: string = null; // 加封设备ID
    public sealDeviceName: string = null; // 加封设备名
    public sealComponentId: string = null; // 加封设备位置ID
    public sealComponentName: string = null; // 加封设备位置名
    public performTime: number = null; // 实施时间,
    // 停电申请信息
    public dueTime: number = null; // 计划停/复电时间
    public powerCutImmediate: number = null; // 是否立即中止供电 0 否，1 是
    public reason: string = null; // 停复电原因
    public reasonId: string = null; // 停复电原因 Id
    public powerCutScope: string = null;   // 停电范围
    public powerCutPhotoIds: string = null; // 停/复电实施的图片Id
    public powerCutThrumnailIds: string = null; // 停/复电实施的缩略图片Id

    public powerCutApplicantName: string = null; //
    public powerCutApplicantId: string = null;
    public powerCutApproverComment: string = null;
    public powerCutApproverName: string = null;
    public powerCutApproveTime: number = null;

    // 表读数信息
    public meterReadingTotal: string = null; // 表底读数有功总
    public meterReadingEmpty: string = null; // 表底读数无功----------这些都是电表的读数
    public meterReadingVolumn: string = null; // 表底读数需量
    public meterReadingTime: number = null; // 表底读数抄表日期
    public meterReadingUp: string = null; // 表底读数峰
    public meterReadingDown: string = null; // 表底读数谷
    public meterReadingNormal: string = null; // 表底读数平

    // extra info, we don't use it now.
    // public applyId: string = null; // 停/复电申请id
    public powerCutApplyStatus: number = null;
    public recoverApplyStatus: number = null;
    public powerCutStatus: number = null;
    public recoverStatus: number = null;
    public powerCutApproveResult: number = null;

    public recordDate: number = null; // 是停电/复电实施时间
    public recordId: string = null; // 实施记录ID
    public payDate: number = null;
    // public recoverApplyTime: string = null;
    public recoverVerifyTime: string = null;

    constructor() {
        super();
        // this.table();
    }

    public table() {
      return {
        tableName: "WorkOrders",
        tableConstructor: {
          id: `${TableColumnType.text}`,
          applyId: TableColumnType.text,
          userId: TableColumnType.text,
          chargeDetailId: `${TableColumnType.text}`,
          createdTime: TableColumnType.int,
          createdBy: TableColumnType.text,
          updatedBy: TableColumnType.text,
          updatedTime: TableColumnType.int,
          type: TableColumnType.int,
          syncStatus: TableColumnType.int,
          workOrderStatus: TableColumnType.int,


          isPerform: TableColumnType.int,
          sysuserId: TableColumnType.int,
          performerOne: TableColumnType.text,
          performerOneMobile: TableColumnType.text,
          performerOneAccount: TableColumnType.text,
          performerTwo: TableColumnType.text,
          performerTwoAccount: TableColumnType.text,
          performerTwoMobile: TableColumnType.text,
          sealType: TableColumnType.int,
          sealNO: TableColumnType.int,
          sealDeviceId: TableColumnType.text,
          sealDeviceName: TableColumnType.text,
          sealComponentId: TableColumnType.text,
          sealComponentName: TableColumnType.text,
          performTime: TableColumnType.int,


          dueTime: TableColumnType.int,
          powerCutImmediate: TableColumnType.int,
          powerCutScope: TableColumnType.text,
          reason: TableColumnType.text,
          reasonId: TableColumnType.int,
          powerCutPhotoIds: TableColumnType.text,
          powerCutThrumnailIds: TableColumnType.text,

          powerCutApplicantName: TableColumnType.text,
          powerCutApplicantId: TableColumnType.text,
          powerCutApproverComment: TableColumnType.text,
          powerCutApproveTime: TableColumnType.int,

          meterReadingTotal: TableColumnType.text,
          meterReadingEmpty: TableColumnType.text,
          meterReadingVolumn: TableColumnType.text,
          meterReadingTime: TableColumnType.int,
          meterReadingUp: TableColumnType.text,
          meterReadingDown: TableColumnType.text,
          meterReadingNormal: TableColumnType.text,

          recordId: TableColumnType.text,
          recordDate: TableColumnType.int,

          powerCutApplyStatus: TableColumnType.int,
          recoverApplyStatus: TableColumnType.int,
          powerCutStatus: TableColumnType.int,
          recoverStatus: TableColumnType.int,
          powerCutApproveResult: TableColumnType.int,
          // applyId: TableColumnType.text,
          payDate: TableColumnType.int,
          // recoverApplyTime: TableColumnType.text,
          recoverVerifyTime: TableColumnType.text,

        }
      };
    }


}



